<template>
  <!-- 大客户线索管理->线索建档 -->
  <div>
    <!-- 搜索 -->
     <TopFilter  :list="topFilterInit" 
     :cols="4"  
     :collapse="collapse"
     labelWidth="90"  
     @filterChange="changeHandle" ></TopFilter>
     <!-- table -->
    <FilterTable   ref="listModal" :columns="columns" :selectionType="'single'"   :fetchapi="fetchParams" :params="flterValue" :datakey="'records'"
      :onColumnsChange="columns => this.columns = columns">
   </FilterTable>
    <div class="dialogBottmView">
      <el-button @click="closeDialog">取 消</el-button>
      <el-button @click="saveDialog" type="primary">分 配</el-button>
    </div>
  </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
export default {
  mixins: [dictionary],
  data() {
    return {
      visible:false,
      visibleDrawer:false,
      collapse:false,
      infoId:null,
      topFilterInit:this.topFilterInitFun(),
      flterValue:{},  //参数
      columns:this.creatHeader(),
      fetchParams:null, //ipa 接口
    };
  },
  methods: {
      //搜索数据
      topFilterInitFun(){
        return [
            { type: 'INPUT',   label: '大客户事业部', fieldName: 'field1', placeholder: '请输入',initialValue: '' },
            { type: 'INPUT',  label: '员工编号',  fieldName: 'field2',  placeholder: '请选择', initialValue: "" },
            { type: 'INPUT',  label: '员工名称', fieldName: 'field3',   placeholder: '请选择', initialValue: "" },
        ]
      },
      //搜索获取数据
      changeHandle(val){
          this.flterValue=val
          console.log(val)
      },
      //table表头和数据源
      creatHeader(){
         return [
         {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
         },
        { title: '员工编号',  dataIndex: 'field0', sorter: true},
        { title: '员工姓名',  dataIndex: 'field1', sorter: true},
        { title: '大客户事业部',  dataIndex: 'field2', sorter: true},
        { title: '职位',   dataIndex: 'field3', sorter: true},
        { title: '手机',    dataIndex: 'field4',  sorter: true},
        { title: '邮箱',  dataIndex: 'field5',   sorter: true}
        ]
      },
        //保存
    saveDialog(){
      this.$emit('close', {visible:false,});
    },
    //取消操作
    closeDialog(){
      this.$emit('close', {visible:false,});
    }
  }
};
</script>

<style lang="less" scoped>
</style>
